package com.books.entity;

import java.io.Serializable;
import java.util.Date;

/**
 * ebook_entry
 * @author 
 */

public class EbookEntry implements Serializable {
    /**
     * 编号
     */
    private Integer id;

    /**
     * 分类编号
     */
    private Integer categoryId;

    /**
     * 图书名称
     */
    private String title;

    /**
     * 摘要
     */
    private String summary;

    /**
     * 上传人
     */
    private String uploaduser;

    /**
     * 上传时间
     */
    private Date ceratetime;
    /**
     * 维护电子图书条目表和电子图书分类表的一对一关系
     */
    private EbookCategory ebookCategory;

    public EbookCategory getEbookCategory() {
        return ebookCategory;
    }

    public void setEbookCategory(EbookCategory ebookCategory) {
        this.ebookCategory = ebookCategory;
    }

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getUploaduser() {
        return uploaduser;
    }

    public void setUploaduser(String uploaduser) {
        this.uploaduser = uploaduser;
    }

    public Date getCeratetime() {
        return ceratetime;
    }

    public void setCeratetime(Date ceratetime) {
        this.ceratetime = ceratetime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EbookEntry other = (EbookEntry) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getSummary() == null ? other.getSummary() == null : this.getSummary().equals(other.getSummary()))
            && (this.getUploaduser() == null ? other.getUploaduser() == null : this.getUploaduser().equals(other.getUploaduser()))
            && (this.getCeratetime() == null ? other.getCeratetime() == null : this.getCeratetime().equals(other.getCeratetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getSummary() == null) ? 0 : getSummary().hashCode());
        result = prime * result + ((getUploaduser() == null) ? 0 : getUploaduser().hashCode());
        result = prime * result + ((getCeratetime() == null) ? 0 : getCeratetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", title=").append(title);
        sb.append(", summary=").append(summary);
        sb.append(", uploaduser=").append(uploaduser);
        sb.append(", ceratetime=").append(ceratetime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}